﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DARE
{
    public enum EOrder
    {
        REGULAR,
        BACKTOFRONT,
        FRONTTOBACK
    }

    public enum EType
    {
        STATIC,
        DYNAMIC
    }

    /// <summary>
    /// This is the object stored in the space partitioner (see IPartitioner).
    /// </summary>
    public interface IPartitionerItem
    {
        /// <summary>
        /// Item's id.
        /// </summary>
        int Id { get; }

        /// <summary>
        /// Item's type, static / dynamic
        /// </summary>
        EType Type { get; set; }

        /// <summary>
        /// If an item is not active it will not be updated / draw
        /// </summary>
        bool IsActive { get; set; }

        /// <summary>
        /// Bounding box of the object stored in the space partioner, used to know if it collide 
        /// with a sphere, box, frustrum...
        /// </summary>
        BoundingBox AABB { get; set; }
        IPartitionerItemModel AABBModel { get; set; }

        int LOD { get; set; }
        float DistFromCam { get; set; }

        /// <summary>
        /// Position of the object in 3d.
        /// </summary>
        Vector3 Position { get; set; }

        /// <summary>
        /// Order.
        /// </summary>
        EOrder Order { get; set; }

        /// <summary>
        /// Event raised to notify that the object moved.
        /// </summary>
        event EventHandler eItemMoved;

        /// <summary>
        /// Event raised to notify that the object stopped moving.
        /// </summary>
        event EventHandler eItemStopped;
    }
}
